/*
 * @Author: 宋杰
 * @Date: 2020-12-25 20:19:16
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2021-01-26 09:49:00
 * @Description: 一家十一口(猜一字)
 */
import Vue from 'vue'
import Router from 'vue-router'
const routerPush = Router.prototype.push
// 原因：在路由中添加了相同的路由。
// 解决方案：重写路由的push方法
Router.prototype.push = function push(location) {
  return routerPush.call(this, location).catch(error => error)
}

// 菜单页==========================================================
import Mhead from '@/components/login/Mhead.vue' //管理菜单页面
import head from '@/components/login/head.vue' //机构菜单页面
// 菜单页 end======================================================

// 游客\登录页 ==========================================================
import login from '@/components/login'
import registered from '@/components/registered' //登录注册sj
import touristshome from '@/components/tourists/touristshome' //游客首页sj
import touristsinfo from '@/components/tourists/touristsinfo' //游客对外展示信息sj
import APagencyPageHome from '@/components/agencyPage/agencyPageHome' //机构页面首页 sj
// 游客\登录页 end==========================================================


// 管理员端=============================================
import assessmentAudit from '@/components/TheClient/ReviewSummary/assessmentAudit.vue' //审核汇总>>>评估审核 sj
import EvaluationAuditProcessPage from '@/components/TheClient/ReviewSummary/EvaluationAuditProcessPage.vue' //审核汇总>>>评估审核流程页 sj
import RegistrationAudit from '@/components/TheClient/RegistrationAudit/RegistrationAudit.vue' //注册审核 sj
import RegisterAuditProcessPage from '@/components/TheClient/RegistrationAudit/RegisterAuditProcessPage.vue' //注册审核 >>> 注册审核流程页sj
import OrganizationManagement from '@/components/TheClient/OrganizationManagement/OrganizationManagement.vue' //机构管理 sj
import OMtoview from '@/components/TheClient/OrganizationManagement/OMtoview.vue' //机构管理>>>查看 sj
import OMtoviewSH from '@/components/TheClient/OrganizationManagement/OMtoviewSH.vue' //机构管理>>>查看 sj
import OMmodify from '@/components/TheClient/OrganizationManagement/OMmodify.vue' //机构管理>>>查看 sj
import CIInstitutions from '@/components/TheClient/CreditIn/CIInstitutions.vue' //机构管理>>> 按机构 sj
import CIEvaluationactivity from '@/components/TheClient/CreditIn/CIEvaluationactivity.vue' //机构管理>>> 安评价活动 sj
import EvaluationOpening from '@/components/TheClient/CreditEvaluation/EvaluationOpening.vue' //信用评价 >>> 评估开放 sj
import AssessmentOpenDetails from '@/components/TheClient/CreditEvaluation/AssessmentOpenDetails.vue' //信用评价 >>> 评估开放 被评审的机构一览 sj
import AApplicationInformation from '@/components/TheClient/CreditEvaluation/AApplicationInformation.vue' //信用评价 >>> 评估开放>>>被评审的机构一览>>>评估申请资料 sj
import AssessmentReviewed from '@/components/TheClient/CreditEvaluation/AssessmentReviewed.vue' //信用评价 >>> 待审核的评估页面 sj
import CreditComplaint from '@/components/TheClient/CreditEvaluation/CreditComplaint.vue'   //信用申诉 >>> 被评审的机构一览 sj
import ScoreStandard from '@/components/TheClient/ScoreStandard/ScoreStandard.vue' //分值标准 sj
import AccountManagement from '@/components/TheClient/AccountManagement/AccountManagement.vue' //账号管理 sj
import Announcements from '@/components/TheClient/Announcements/Announcements.vue' //通知公告 sj
// 管理员端end=======================================================


// 机构用户页==========================================================
import HomePage from '@/components/HomePage/HomePage.vue' //首页
import HomePageArticle from '@/components/HomePage/HomePageArticle.vue' //首页>>>文章新闻
import gradeEvaluation from '@/components/gradeEvaluation/gradeEvaluation.vue' //等级评估
import AnnualRatingAssessment from '@/components/gradeEvaluation/AnnualRatingAssessment.vue' //年度等级评估
import creditInquiry from '@/components/creditInquiry/creditInquiry.vue' //信用查询
import UserInformation from '@/components/UserInformation/UserInformation.vue' //用户信息
import BusinessProject from '@/components/BusinessProject/BusinessProject.vue' //经营项目
import creditReward from '@/components/creditReward/creditReward.vue' //信用奖罚
import institutions from '@/components/institutions' //机构登录页
// 机构用户页 end==========================================================


Vue.use(Router)
// 机构
export const institutionRoutes = [//机构
  {
    path: '/',
    // name: 'head',
    component: head,
    children: [
      {
        path: '/',
        redirect: 'HomePage',
      },
      {//首页
        path: 'HomePage',
        name: 'HomePage',
        component: HomePage,
      },
      {//查看首页文章 sj
        path: 'HomePageArticle',
        name: 'HomePageArticle',
        component: HomePageArticle,
      },
      {//等级评估
        path: 'gradeEvaluation',
        name: 'gradeEvaluation',
        component: gradeEvaluation,
      },
      {//等级评估
        path: 'AnnualRatingAssessment',
        name: 'AnnualRatingAssessment',
        component: AnnualRatingAssessment,
      },
      {//信用查询
        path: 'creditInquiry',
        name: 'creditInquiry',
        component: creditInquiry,
      },
      {//用户信息
        path: 'UserInformation',
        name: 'UserInformation',
        component: UserInformation,
      },
      {//经营项目
        path: 'BusinessProject',
        name: 'BusinessProject',
        component: BusinessProject,
      },
      {//信用奖罚
        path: 'creditReward',
        name: 'creditReward',
        component: creditReward,
      }
    ]
  }
]
//管理端
export const adminRoutes = [
  // {
  //   path: '/',
  //   name: 'login',
  //   component: login,
  // },
  {
    path: '/',
    // name: 'Mhead',
    component: Mhead,
    children: [
      {//首页
        path: '/',
        redirect: 'OrganizationManagement',
      },
      // 评估审核
      {
        path: 'assessmentAudit',
        name: 'assessmentAudit',
        component: assessmentAudit,
      },
      // 评估审核流程页
      {
        path: 'EvaluationAuditProcessPage',
        name: 'EvaluationAuditProcessPage',
        component: EvaluationAuditProcessPage,
      },
      // 注册审核
      {
        path: 'RegistrationAudit',
        name: 'RegistrationAudit',
        component: RegistrationAudit,
      },
      // 注册审核流程页sj
      {
        path: 'RegisterAuditProcessPage',
        name: 'RegisterAuditProcessPage',
        component: RegisterAuditProcessPage,
      },
      // 机构管理
      {
        path: 'OrganizationManagement',
        name: 'OrganizationManagement',
        component: OrganizationManagement,
      },
      // 机构管理 >>>查看
      {
        path: 'OMtoview',
        name: 'OMtoview',
        component: OMtoview,
      },
      // 机构管理 >>>查看
      {
        path: 'OMtoviewSH',
        name: 'OMtoviewSH',
        component: OMtoviewSH,
      },
      // 机构管理 >>>修改
      {
        path: 'OMmodify',
        name: 'OMmodify',
        component: OMmodify,
      },
      // 机构管理 >>>信用一览>>>按机构
      {
        path: 'CIInstitutions',
        name: 'CIInstitutions',
        component: CIInstitutions,
      },
      // 机构管理 >>>信用一览>>>按评价活动
      {
        path: 'CIEvaluationactivity',
        name: 'CIEvaluationactivity',
        component: CIEvaluationactivity,
      },

      // 信用评价 >>>评估开放 
      {
        path: 'EvaluationOpening',
        name: 'EvaluationOpening',
        component: EvaluationOpening,
      },
      // 信用评价 >>>评估开放 被评审的机构一览
      {
        path: 'AssessmentOpenDetails',
        name: 'AssessmentOpenDetails',
        component: AssessmentOpenDetails,
      },
      // 信用评价 >>>评估开放 >>>>被评审的机构一览 >>>评估申请资料
      {
        path: 'AApplicationInformation',
        name: 'AApplicationInformation',
        component: AApplicationInformation,
      },
      // 信用评价 >>>评估开放 待审核的评估页面
      {
        path: 'AssessmentReviewed',
        name: 'AssessmentReviewed',
        component: AssessmentReviewed,
      },
      // 信用评价 >>>评估开放 被评审的机构一览
      {
        path: 'CreditComplaint',
        name: 'CreditComplaint',
        component: CreditComplaint,
      },

      // 分值标准
      {
        path: 'ScoreStandard',
        name: 'ScoreStandard',
        component: ScoreStandard,
      },

      // 账号管理
      {
        path: 'AccountManagement',
        name: 'AccountManagement',
        component: AccountManagement,
      },
      // 通知公告
      {
        path: 'Announcements',
        name: 'Announcements',
        component: Announcements,
      },
    ]
  }
]

// 游客 、登录页
export default new Router({
  mode: 'hash',
  // mode: 'history',
  linkActiveClass: 'active',

  routes: [
    // 游客页面
    {
      path: '/',
      name: 'touristsinfo',
      component: touristsinfo,
    },
    // 游客对外展示信息
    {
      path: '/touristshome',
      name: 'touristshome',
      component: touristshome,
    },
    // 管理员系统登录页
    {
      path: '/login',
      name: 'login',
      component: login,
    },
    // 注册页面
    {
      path: '/registered',
      name: 'registered',
      component: registered,
    },
    // 机构登录页
    {
      path: '/institutions',
      name: 'institutions',
      component: institutions,
    },

  ],
})

